﻿Ext.define('Examples.order.orderitem.view.Grid', {
    extend: 'Happy.grid.Panel',
    alias: 'widget.orderitem-grid',
    requires: [
        'Happy.table.action.Refresh',
        'Happy.table.action.New',
        'Happy.table.action.Edit',
        'Happy.grid.action.Delete',
        'Examples.order.orderitem.store.Store',
        'Examples.order.orderitem.view.Form'
    ],

    columns: [
        { text: 'Product', dataIndex: 'Product' }
    ],

    initComponent: function () {
        var me = this;

        me.tbar = Happy.createActions([
            {
                type: 'new',
                showStrategy: {
                    title: 'new form',
                    formType: 'orderitem-form'
                }
            },
            {
                type: 'edit',
                remoteLoad: false,
                showStrategy: {
                    title: 'edit form',
                    formType: 'orderitem-form'
                }
            },
            { type: 'grid-delete', remoteDelete: false }
        ]);

        me.callParent(arguments);
    }
});